package com.macro.mall;

import com.macro.mall.common.util.AESUtil;
import com.macro.mall.common.util.RSAUtil;
import com.macro.mall.operating.starter.annotation.EnableLogRecord;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

import java.util.Map;

/**
 * 应用启动入口
 * Created by macro on 2018/4/26.
 */
@Slf4j
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
@EnableLogRecord(tenant = "Admin", joinTransaction = false)//默认不影响事务
public class MallAdminApplication {
    public static void main(String[] args) {
        SpringApplication.run(MallAdminApplication.class, args);
        try {
            String aesKey = AESUtil.getAESKey(16);
            Map map = RSAUtil.generateRandomToBase64Key();
            log.info("加密：AES：" + aesKey);

            log.info("加密：publicKey：" + map.get("publicKey"));
            log.info("加密：privateKey：" + map.get("privateKey"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }


    }

}
